package wisents.wicket;

import pl.rabbitsoftware.EnhancedWicketTester;
import wisents.api.Clickable;
import wisents.api.factory.Vendor;

/**
 * Created by IntelliJ IDEA.
 * User: rabbit
 * Date: Jan 19, 2010
 * Time: 11:32:38 PM
 * To change this template use File | Settings | File Templates.
 */
public class WicketClickable extends WicketPageElement implements Clickable {

    private final EnhancedWicketTester enhancedWicketTester;

    public WicketClickable(String path) {
    	super(path);
        enhancedWicketTester = ((WicketVendor) Vendor.getInstance()).getEnhancedTester();
    }

    public void click() {
        enhancedWicketTester.clickLink(this.path());
    }

    public void ajaxClick() {
        enhancedWicketTester.clickAjaxLink(this.path());
    }
}
